package exe;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class ExeHash_01 {
    public static void main(String[] args) throws IOException {
        ProcessBuilder processBuilder = new ProcessBuilder();
        ProcessBuilder command = processBuilder.command(
                "CertUtil",
                "-HashFile",
                "D:\\HeiMaStore\\postman.png",
                "MD5");
        Process start = command.start();
        InputStream inputStream = start.getInputStream();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "GBK"));
        String result = "";
        String line = null;
        while((line = bufferedReader.readLine()) != null){
            result += line;
        }
        System.out.println(result);
    }
}
